//
//  QuxiaoQCViewController.m
//  YaoHeAPP
//
//  Created by xyh on 16/1/5.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "QuxiaoQCViewController.h"
#import "Controller.h"
#import "Masonry.h"
@interface QuxiaoQCViewController ()
{

    UILabel *name;
}
@end

@implementation QuxiaoQCViewController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:@"QuxiaoQCViewController"];
    
    [[self rdv_tabBarController] setTabBarHidden:YES animated:YES];
    
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"QuxiaoQCViewController"];
    
    [[self rdv_tabBarController] setTabBarHidden:NO animated:YES];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.backgroundColor=bgVCcolor;
    //加一个导航条
    UIView*navcBar=[[UIView alloc]init];
    navcBar.backgroundColor=[UIColor colorWithRed:90.f/255.f green:191.f/255.f blue:219.f/255.f alpha:1];
    [self.view addSubview:navcBar];
    [self.view bringSubviewToFront:navcBar];
    [navcBar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(0);   make.left.offset(0);
        make.height.offset(60);  make.right.offset(0);
    }];
    //导航条标题
    UILabel*titleLabel=[[UILabel alloc]init];
    titleLabel.text=@"取消质检原因";
    titleLabel.font=Font(17);
    titleLabel.textAlignment=NSTextAlignmentCenter;
    titleLabel.textColor=[UIColor whiteColor];
    [navcBar addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(25);
        make.left.offset(self.view.frame.size.width/2-70);
        make.width.offset(140);
        make.height.offset(30);
    }];
    
    //返回按钮
    UIButton*leftButton=[UIButton buttonWithType:UIButtonTypeCustom];
    [leftButton setBackgroundImage:[UIImage imageNamed:@"return"] forState:UIControlStateNormal];
    [leftButton addTarget:self action:@selector(backLogin) forControlEvents:UIControlEventTouchUpInside];
    [navcBar addSubview:leftButton];
    [leftButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(6);
        make.width.offset(24);
        make.height.offset(22);
        make.bottom.offset(-12);
    }];

    
    
    
    
    
    self.view.backgroundColor= [UIColor colorWithRed:230/255.0 green:232/255.0 blue:241/255.0  alpha:1];

//    self.title=@"取消质检原因";
    
    UIView *imview=[[UIView alloc]init];
    imview.frame=CGRectMake(10, 15+60, 3, 20);
    imview.backgroundColor=[UIColor redColor];
    [self.view addSubview:imview];
    
    UILabel *tit=[[UILabel alloc]initWithFrame:CGRectMake(14, 15+60, 200, 20)];
    tit.text=@"取消质检原因";
    [self.view addSubview:tit];
    
    name=[[UILabel alloc]initWithFrame:CGRectMake(10, 50+60, self.view.frame.size.width-20, 20)];
    name.font=[UIFont systemFontOfSize:15];
    name.textColor=[UIColor grayColor];
    [self.view addSubview:name];
    
    
    
    [self  updata];
    
    
    
    
    // Do any additional setup after loading the view.
}
//请求数据
-(void)updata
{
    
    NSString *ido=self.orderid;
    
    NSDictionary*di=@{@"ORDER_ID":ido};
    
    [Controller requestWithURL:POSTLOADQUALITY jsondic:di finishBlock:^(ClassData* data) {
        if ([data.number isEqualToNumber:[NSNumber numberWithInteger:0]])
        {
            name.text=[NSString stringWithFormat:@"%@",data.data[@"CANCEL_CAUSE"]];
        }
        else
        {
            
        }
    }];

}
-(void)backLogin
{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
